using System;
using NHibernate;

namespace UserManagement.Dal.NH
{
    public class UnitOfWork : IUnitOfWork
    {
        #region private fields
        
        private ISession _session;

        #endregion private fields

        #region constructor
        
        public UnitOfWork(ISession session)
        {
            _session = session;
        }

        #endregion constructor

        #region public methods
        
        public T Add<T>(T entity) where T : class
        {
            _session.Save(entity);
            return entity;
        }

        public void Delete<T>(T entity) where T : class
        {
            throw new NotImplementedException();
        }

        public void Update<T>(T entity) where T : class
        {
            throw new NotImplementedException();
        }

        public void Create<T>(T entity, string entityDataName, bool overwriteCurrentDataSource) where T : class
        {
            throw new NotImplementedException();
        }

        public void BeginTransaction()
        {
            throw new NotImplementedException();
        }

        public void CommitTransaction()
        {
            throw new NotImplementedException();
        }

        public void RollbackTransaction()
        {
            throw new NotImplementedException();
        }

        #endregion public methods
    }
}